<?php
/*
 * Created on 08/07/2009
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 	include("Topic.php");
 	class Chapter{
 		
 		private $topics = Array();
 		
 		private $id;
 		
 		private $title;
 		
 		function __construct($id, $title){
 			$this->id=$id;
 			$this->title = $title;
 		}
 		
 		function addTopic($_topic){
 			Array_push($this->topics,$_topic);
 		}
 		
 		function getTopic($id){
 			foreach($this->topics as $chapt)
			{
				if(strcmp($chapt->getId(),$id)==0)
					return $chapt;
			}
			return null;
 		}

		function getTopics(){
			return $this->topics;
		}

		function getId(){
			return $this->id;
		}
		
		function getTitle(){
			return $this->title;
		}
		
		function setTitle($title){
			$this->title = $title;
		}
 	}
?>
